package com.example.click.huanxin.net;

import android.util.Log;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;


/**
 * Created by Chen qin lang on 2016/12/29.
 * 邮箱 :   619766577@qq.com
 * 用于添加有特殊请求的请求
 */
public class loginInterceptor implements Interceptor {
    private String maxage="60";
    private String TAG="Intercepoter";

    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Request build = request.newBuilder().header("Cache-contronl", "max-age public-only-if max" + maxage).build();
        Response proceed = chain.proceed(build);
        Log.d(TAG, "intercept() called with: " + "chain = [" + proceed.headers() + "]");
        return proceed;
    }
}
